typedef double dbl;
const dbl PI=acos(-1),eps=1e-10;

struct point
{
	dbl x,y,z;
	point(dbl _x=0,dbl _y=0,dbl _z=1)
	{
		x=_x; y=_y; z=_z;
	}
	point operator + (const point&b) const
	{
		return point(x+b.x,y+b.y);
	}
	point operator - (const point&b) const
	{
		return point(x-b.x,y-b.y);
	}
	double operator * (const point&b) const
	{
		return x*b.x+y*b.y+z*b.z;
	}
	point operator / (const point&b) const
	{
		return point(y*b.z-z*b.y,z*b.x-x*b.z,x*b.y-y*b.x);
	}
	point operator * (double a)
	{
		return point(x*a,y*a);
	}
	dbl length() const
	{
		return sqrt(x*x+y*y);
	}
	point rotate(dbl theta) const
	{
		return point(x*cos(theta)-y*sin(theta),x*sin(theta)+y*cos(theta));
	}
	point single() const
	{
		dbl o=length();
		return point(x/o,y/o);
	}
	void update()
	{
		x/=z;
		y/=z;
		z=1;
	}
} a[210],b[1010],c[1010],ans0,ans1;

bool inl(point cp,point u,point v)
{
	if ((cp-u).length()<eps) return 1;
	return (cp-u)*(cp-v)<1;
}

auto ins=[&](point u,point v)
{
	point l=u/v;
	b[0]=b[len];
	int tlen=0;
	for(int i=1;i<=len;i++)
	{
		point l2=b[i-1]/b[i];
		point cp=l/l2;
		if (fabs(cp.z)>eps)
		{
			cp.update();
			if (inl(cp,b[i-1],b[i]))
				c[++tlen]=cp;
		}
		if (b[i]*l>0)
			c[++tlen]=b[i];
	}
	for(int i=1;i<=tlen;i++) b[i]=c[i];
	len=tlen;
};

